1. Field of the Invention
The present invention relates to an image processing method, an image processing apparatus, and an image processing program, for extracting edges from digital photographic images, and for obtaining edge data that represents the states of edges within the digital photographic images.
2. Description of the Related Art
Digital photographic images are obtained by photoelectrically reading out photographic images, which are recorded on photographic films, such as negative films and reversal films, using readout apparatuses, such as scanners. Digital photographic images are also obtained by photography using digital still cameras (DSC's). Various image processes are administered on the digital photographic images to display and print them. A blurred image correcting process, for removing blur from blurred images, is an example of such an image process.
There are two types of blurred images. One is focus blur, which is caused by out of focus photography of a subject. The other is shake blur, which is caused by a photographer's hand moving during photography of a subject. In the case of focus blur, point images spread two dimensionally, that is, the spread within the photographic image is non directional. In the case of shake blur, point images spread along a one dimensional trajectory, that is, the spread within the photographic image is directional.
Various methods have been proposed to correct blurred images in the field of digital photographic images. If data, such as the direction of blur and the blur width, are known at the time of photography, it is possible to perform correction by applying correcting filters, such as Wiener filters and reverse filters. Based on this fact, a method for performing blur correction has been proposed in U.S. Patent Application Publication No. 20030002746. In this method, a device (an accelerometer, for example), which is capable of obtaining data, such as the direction of blur and the blur width, during photography is provided on a photography apparatus. Data, such as the blur direction and the blur width, is obtained simultaneously with photography, and correction is performed, based on the obtained data.
There is another known method for correcting blur, as disclosed in Japanese Unexamined Patent Publication No. 7(1995)-121703. In this method, deterioration functions are set for blurred images (images that contain blur), and the blurred images are corrected using a correction filter that corresponds to the set deterioration function. Then, the corrected images are evaluated, and deterioration functions are reset, based on the results of the evaluations. Correction, evaluation, and resetting of the deterioration function is repeated until a desired image quality is obtained.
Meanwhile, accompanying the rapid spread of cellular telephones, the functions thereof have improved. Among these functions, attention is being paid to the advances in functionality of digital cameras built into cellular telephones (hereinafter, simply referred to as “cell phone cameras”). In recent years, the number of pixels of cell phone cameras has increased to millions of pixels, and the cell phone cameras are being utilized in a manner similar to that of regular digital cameras. Not only are commemorative photographs taken on trips with friends, but cell phone cameras are also being used to photograph celebrities and athletes. In view of these circumstances, photographic images obtained by photography using cell phone cameras are not only viewed on monitors of cellular telephones. It is often the case that photographic images obtained by cell phone cameras are printed in the same manner as those obtained by regular digital cameras.
Cell phone cameras are difficult to hold during photography, as the bodies (cellular telephones) thereof are not ergonomically designed specifically for photography. In addition, cell phone cameras have slower shutter speeds compared to regular digital cameras, because they do not have flash photography functions. For these reasons, shake blur is more likely to occur during photography of subjects using cell phone cameras than during photography of subjects using regular digital cameras. Extreme cases of shake blur can be discerned on the monitors of the cell phone cameras, but small shake blurs may not be discerned on the monitors, and only noticed after printing of the images. Therefore, the necessity for blur correction to be administered onto photographic images obtained by photography using cell phone cameras is high.
Miniaturization of cellular telephones is a point of competition for cellular telephone manufacturers, along with the functions and cost thereof. Therefore, it is not realistic to provide a device that obtains blur directions and blur widths within cell phone cameras. Accordingly, the method proposed in U.S. Patent Application Publication No. 20030002746 cannot be applied to cell phone cameras. In addition, the method disclosed in Japanese Unexamined Patent Publication No. 7(1995)-121703 has a problem that the repetition of: setting of the deterioration function; correction; evaluation; and resetting of the deterioration function takes processing time, and therefore is inefficient. Therefore, a blur correcting method may be considered, in which blur data of a digital photographic image (blur direction, blur width and the like) is obtained by analyzing the digital photographic image, correcting parameters are set based on the obtained blur data, and correction is performed employing the set parameters. Blur causes spreading of point images within images. Therefore, spreading of edges corresponding to the spreading of point images is generated in blurred images. That is, the states of the edges within images are directly related to the blur within the images. Utilizing this fact, a method, in which the states of edges within images are analyzed to obtain blur data, then the blur data is employed to perform blur correction, may be considered. This method enables obtainment of blur data from digital photographic images, without providing a specialized device in photography apparatuses. At the same time, correction is performed based on blur data, therefore there is no need to repeat processes, as in the method disclosed in Japanese Unexamined Patent Publication No. 7(1995)-121703, and the method is efficient.
It is necessary to extract edges from digital photographic images, in order to obtain blur data by analyzing the digital photographic images. However, if edges are extracted from digital photographic images in their original sizes, the edge extraction process takes time. In addition, the number of extracted edges will be high, which will cause analysis, which is performed later, to take time as well. Therefore, edges are extracted from reduced images, obtained by administering reduction processes on digital photographic images.
However, the sizes of digital photographic images vary. If large digital photographic images are reduced at the same reduction intensity as that for a small digital photographic image, then edges are extracted from the reduced image obtained thereby, the edge extraction process takes time. In addition, the number of extracted edges will be high, which will cause analysis, which is performed later, to take time as well. These factors cause a problem of inefficiency in processing. On the other hand, if a small digital photographic image is reduced at an reduction intensity suitable for large digital photographic images to shorten processing times, then edges are extracted from the reduced image obtained thereby, the number of extracted edges will be small. Therefore, the accuracy of the analysis, which is performed later, is decreased.